import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/home'
  },
  {
    // 主页路由
    path: '/home',
    name: 'Home',
    component: Home,
  },
  {
    // 歌单列表路由
    path: '/playlist',
    name: 'Playlist',
    component: () => import('@/components/home/Playlist.vue')
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/About.vue')
  },
  {
    // 歌单详情路由
    path: "/playlistDetail",
    name: "PlaylistDetail",
    component: () => import('@/components/playlistDetail/PlaylistDetail.vue')
  }, 
  {
    // 主播电台
    path: '/anchorstation',
    name: 'Anchorstation',
    component: () => import('../components/Anchorstation/Anchorstation.vue')
  },
  {
    // 我的音乐
    path: '/mySong',
    name: 'MySong',
    component: () => import("../views/MySong.vue"),
    children:[
      {
      path:"/mySinger",
      name:"MySinger",
      component:() => import("../components/mysong/Mysinger.vue")
    },
    {
      path:"/myMv",
      name:"MyMv",
      component:() => import("../components/mysong/MyMv.vue")
    },
    {
      path:"/mySongs",
      name:"MySongs",
      component:() => import("../components/mysong/MySongs.vue")  
    },
  ]
  },
  // 歌曲详情路由
  {
    path:'/songDetail',
    name:"SongDetail",
    component: () => import('@/components/playlistDetail/SongDetail.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router